package com.rock.goc.data.controller;

import java.util.Arrays;
import java.util.Map;

//import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.rock.goc.data.entity.ProcessInfoEntity;
import com.rock.goc.data.service.ProcessInfoService;
import com.rock.common.utils.PageUtils;
import com.rock.common.utils.R;



/**
 * 
 *
 * @author rock
 * @email 1946920097@qq.com
 * @date 2022-11-29 11:29:58
 */
@RestController
@RequestMapping("data/processinfo")
public class ProcessInfoController {
    @Autowired
    private ProcessInfoService processInfoService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    //@RequiresPermissions("data:processinfo:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = processInfoService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    //@RequiresPermissions("data:processinfo:info")
    public R info(@PathVariable("id") Integer id){
		ProcessInfoEntity processInfo = processInfoService.getById(id);

        return R.ok().put("processInfo", processInfo);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    //@RequiresPermissions("data:processinfo:save")
    public R save(@RequestBody ProcessInfoEntity processInfo){
		processInfoService.save(processInfo);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    //@RequiresPermissions("data:processinfo:update")
    public R update(@RequestBody ProcessInfoEntity processInfo){
		processInfoService.updateById(processInfo);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    //@RequiresPermissions("data:processinfo:delete")
    public R delete(@RequestBody Integer[] ids){
		processInfoService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
